package com.euond.permission.mapper;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.euond.common.core.dao.BaseEuondMapper;
import com.euond.permission.dto.DataPrivilegeDtlDto;
import com.euond.permission.entities.DataPrivilegeDtl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by user on 2018/1/6.
 */
@Mapper
public interface DataPrivilegeDtlMapper extends BaseEuondMapper<DataPrivilegeDtl> {

    /**
     * 根据权限配置ID查询权限配置明细(分页)
     * @param privilegeId
     * @return
     */
    public List<DataPrivilegeDtl> findDataPrivilegeDtlByPrivilegeId(Pagination page, @Param("privilegeId") Long privilegeId);

    /**
     * 查询数据权限需要的数据
     * @param privilegeId,resourceUrl
     * @return
     */
    public List<DataPrivilegeDtlDto> findDataPrivilegeDtlDto(@Param("privilegeId") Long privilegeId, @Param("resourceUrl") String resourceUrl);

    /**
     * 根据权限配置ID查询所有的资源(url)
     * @param privilegeId
     * @return
     */
    public List<DataPrivilegeDtlDto> findDataPrivilegeDtlResource(@Param("privilegeId") long privilegeId);
}
